package top.bug.blog.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import top.bug.blog.utils.UpYunUtil;

import javax.annotation.PostConstruct;

/**
 * @author <a href="https://github.com/jiusi66">九思.</a>
 * @email 10837907@qq.com
 * @from <a href="https://www.52bug.top">递归茶馆-www.52bug.top</a>
 * @description 又拍云 配置类
 */
@Component
@ConfigurationProperties(prefix = "upyun")
@Data
public class UpYunConfig {
    private String bucketName;
    private String username;
    private String password;
    private String domain;

    /**
     * 初始化又拍云工具类
     */
    @PostConstruct
    public void initUpYunUtil() {
        UpYunUtil.initConfig(bucketName, username, password, domain);
    }
}